package com.obaamilos.accesscontrol;

public class ListaUsuarios<E> extends ListaObj<E> {

	public Usuario encontrarToken(String ptoken) {
		NNodo<E> current = head;
		while (current != null) {
			Usuario mUsu = (Usuario)current.getElement();
			if (mUsu.getToken().equals(ptoken)) {
				return mUsu;
			}
			current = current.getNext();
		}
		return null;
	}
	
	public Usuario encontrarLogin(String plogin) {
		NNodo<E> current = head;
		while (current != null) {
			Usuario mUsu = (Usuario)current.getElement();
			if (mUsu.getLogin().equals(plogin)) {
				return mUsu;
			}
			current = current.getNext();
		}
		return null;
	}
}
